package org.andromeo;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
/**
 * "About"/"credits" activity.
 * @author fabian
 *
 */
public class AboutActivity extends Activity {

	Button backButton;
	TextView urlTextView;

	protected void onCreate(android.os.Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.aboutinfo);

		backButton = (Button) findViewById(R.id.backButton);
		backButton.setOnClickListener(backButtonListener);

		urlTextView = (TextView) findViewById(R.id.andromeoURLTextView);
		urlTextView.setOnClickListener(urlButtonListener);

	};

	OnClickListener backButtonListener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			AboutActivity.this.finish();
		}
	};

	OnClickListener urlButtonListener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			Intent callUrl = new Intent("android.intent.action.VIEW",
					Uri.parse(getString(R.string.url_home)));
			callUrl.addCategory("android.intent.category.BROWSABLE");
			startActivity(callUrl);
		}
	};
}
